using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIModel_UIMenu_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIModel.UIMenu);
            args = new Type[]{};
            method = type.GetMethod("get_UIRoot", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_UIRoot_0);
            args = new Type[]{};
            method = type.GetMethod("get_Instance", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Instance_1);
            args = new Type[]{typeof(huqiang.UIModel.UIMenu)};
            method = type.GetMethod("set_Instance", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_Instance_2);
            args = new Type[]{typeof(huqiang.Core.HGUI.UIElement)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_3);
            args = new Type[]{};
            method = type.GetMethod("HideMenu", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, HideMenu_4);
            args = new Type[]{};
            method = type.GetMethod("ReSize", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, ReSize_5);
            args = new Type[]{};
            method = type.GetMethod("get_CurrentMenu", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_CurrentMenu_6);
            args = new Type[]{};
            method = type.GetMethod("ReleaseMenu", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, ReleaseMenu_7);
            args = new Type[]{typeof(huqiang.UIModel.UIBase), typeof(UnityEngine.Rect), typeof(System.Int32), typeof(System.Object)};
            method = type.GetMethod("Show", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Show_8);
            args = new Type[]{};
            method = type.GetMethod("Hide", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Hide_9);
            args = new Type[]{};
            method = type.GetMethod("Dispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispose_10);

            field = type.GetField("LeftTop", flag);
            app.RegisterCLRFieldGetter(field, get_LeftTop_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_LeftTop_0, null);
            field = type.GetField("Top", flag);
            app.RegisterCLRFieldGetter(field, get_Top_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Top_1, null);
            field = type.GetField("RightTop", flag);
            app.RegisterCLRFieldGetter(field, get_RightTop_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_RightTop_2, null);
            field = type.GetField("Right", flag);
            app.RegisterCLRFieldGetter(field, get_Right_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Right_3, null);
            field = type.GetField("RightDown", flag);
            app.RegisterCLRFieldGetter(field, get_RightDown_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_RightDown_4, null);
            field = type.GetField("Down", flag);
            app.RegisterCLRFieldGetter(field, get_Down_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_Down_5, null);
            field = type.GetField("LeftDown", flag);
            app.RegisterCLRFieldGetter(field, get_LeftDown_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_LeftDown_6, null);
            field = type.GetField("Left", flag);
            app.RegisterCLRFieldGetter(field, get_Left_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_Left_7, null);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIModel.UIMenu());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIModel.UIMenu[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_UIRoot_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.UIModel.UIMenu.UIRoot;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* get_Instance_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.UIModel.UIMenu.Instance;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_Instance_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIModel.UIMenu @value = (huqiang.UIModel.UIMenu)typeof(huqiang.UIModel.UIMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.UIModel.UIMenu.Instance = value;

            return __ret;
        }

        static StackObject* Initial_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIElement @Canvas = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.UIModel.UIMenu.Initial(@Canvas);

            return __ret;
        }

        static StackObject* HideMenu_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            huqiang.UIModel.UIMenu.HideMenu();

            return __ret;
        }

        static StackObject* ReSize_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIModel.UIMenu instance_of_this_method = (huqiang.UIModel.UIMenu)typeof(huqiang.UIModel.UIMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.ReSize();

            return __ret;
        }

        static StackObject* get_CurrentMenu_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.UIModel.UIMenu.CurrentMenu;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* ReleaseMenu_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            huqiang.UIModel.UIMenu.ReleaseMenu();

            return __ret;
        }

        static StackObject* Show_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 5);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @obj = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @dic = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Rect @pos = (UnityEngine.Rect)typeof(UnityEngine.Rect).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIModel.UIBase @context = (huqiang.UIModel.UIBase)typeof(huqiang.UIModel.UIBase).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 5);
            huqiang.UIModel.UIMenu instance_of_this_method = (huqiang.UIModel.UIMenu)typeof(huqiang.UIModel.UIMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Show(@context, @pos, @dic, @obj);

            return __ret;
        }

        static StackObject* Hide_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIModel.UIMenu instance_of_this_method = (huqiang.UIModel.UIMenu)typeof(huqiang.UIModel.UIMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Hide();

            return __ret;
        }

        static StackObject* Dispose_10(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIModel.UIMenu instance_of_this_method = (huqiang.UIModel.UIMenu)typeof(huqiang.UIModel.UIMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispose();

            return __ret;
        }


        static object get_LeftTop_0(ref object o)
        {
            return huqiang.UIModel.UIMenu.LeftTop;
        }

        static StackObject* CopyToStack_LeftTop_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.LeftTop;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Top_1(ref object o)
        {
            return huqiang.UIModel.UIMenu.Top;
        }

        static StackObject* CopyToStack_Top_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.Top;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_RightTop_2(ref object o)
        {
            return huqiang.UIModel.UIMenu.RightTop;
        }

        static StackObject* CopyToStack_RightTop_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.RightTop;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Right_3(ref object o)
        {
            return huqiang.UIModel.UIMenu.Right;
        }

        static StackObject* CopyToStack_Right_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.Right;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_RightDown_4(ref object o)
        {
            return huqiang.UIModel.UIMenu.RightDown;
        }

        static StackObject* CopyToStack_RightDown_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.RightDown;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Down_5(ref object o)
        {
            return huqiang.UIModel.UIMenu.Down;
        }

        static StackObject* CopyToStack_Down_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.Down;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_LeftDown_6(ref object o)
        {
            return huqiang.UIModel.UIMenu.LeftDown;
        }

        static StackObject* CopyToStack_LeftDown_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.LeftDown;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Left_7(ref object o)
        {
            return huqiang.UIModel.UIMenu.Left;
        }

        static StackObject* CopyToStack_Left_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIModel.UIMenu.Left;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIModel.UIMenu();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
